<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>3dchess: GuiObserver Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">3dchess
   </div>
   <div id="projectbrief">Basic chess application with OpenGL graphics and AI</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="class_gui_observer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">GuiObserver Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Allows to observe relevant GameEvents inside the <a class="el" href="class_game_logic.html" title="GameLogic implementation for a game of chess with observers. ">GameLogic</a>.  
 <a href="class_gui_observer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_gui_observer_8h_source.html">GuiObserver.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for GuiObserver:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_gui_observer.png" usemap="#GuiObserver_map" alt=""/>
  <map id="GuiObserver_map" name="GuiObserver_map">
<area href="class_abstract_game_observer.html" title="Allows to observe relevant GameEvents inside the GameLogic. " alt="AbstractGameObserver" shape="rect" coords="0,0,145,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:abe55c1eea61c69281828f1ab99d1ee29"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gui_observer.html#abe55c1eea61c69281828f1ab99d1ee29">GuiObserver</a> (ChessSetPtr chessSetPtr, <a class="el" href="class_game_play.html">GamePlay</a> &amp;gamePlayState)</td></tr>
<tr class="memdesc:abe55c1eea61c69281828f1ab99d1ee29"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new observer object.  <a href="#abe55c1eea61c69281828f1ab99d1ee29">More...</a><br/></td></tr>
<tr class="separator:abe55c1eea61c69281828f1ab99d1ee29"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51629917c7dad975609789161c34bc88"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gui_observer.html#a51629917c7dad975609789161c34bc88">onGameStart</a> (<a class="el" href="class_game_state.html">GameState</a> state, <a class="el" href="class_game_configuration.html">GameConfiguration</a> config) override</td></tr>
<tr class="memdesc:a51629917c7dad975609789161c34bc88"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the game starts.  <a href="#a51629917c7dad975609789161c34bc88">More...</a><br/></td></tr>
<tr class="separator:a51629917c7dad975609789161c34bc88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3cc6e321d1c7abc8d2c1b80b747e084"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gui_observer.html#aa3cc6e321d1c7abc8d2c1b80b747e084">onTurnStart</a> (PlayerColor who) override</td></tr>
<tr class="memdesc:aa3cc6e321d1c7abc8d2c1b80b747e084"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called if a player is asked to perform a turn.  <a href="#aa3cc6e321d1c7abc8d2c1b80b747e084">More...</a><br/></td></tr>
<tr class="separator:aa3cc6e321d1c7abc8d2c1b80b747e084"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f031bc566bff47e84165b0e61e435a8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gui_observer.html#a7f031bc566bff47e84165b0e61e435a8">onTurnEnd</a> (PlayerColor who, <a class="el" href="class_turn.html">Turn</a> turn, <a class="el" href="class_game_state.html">GameState</a> newState) override</td></tr>
<tr class="memdesc:a7f031bc566bff47e84165b0e61e435a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called if a player ended its turn.  <a href="#a7f031bc566bff47e84165b0e61e435a8">More...</a><br/></td></tr>
<tr class="separator:a7f031bc566bff47e84165b0e61e435a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12560de73f266b1bbcf9b1dd46c65758"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gui_observer.html#a12560de73f266b1bbcf9b1dd46c65758">onTurnTimeout</a> (PlayerColor who, std::chrono::seconds timeout) override</td></tr>
<tr class="memdesc:a12560de73f266b1bbcf9b1dd46c65758"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called if a players turn is aborted due to timeout.  <a href="#a12560de73f266b1bbcf9b1dd46c65758">More...</a><br/></td></tr>
<tr class="separator:a12560de73f266b1bbcf9b1dd46c65758"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fe98e84fb66f6c0b607a956880c1bfb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gui_observer.html#a1fe98e84fb66f6c0b607a956880c1bfb">onGameOver</a> (<a class="el" href="class_game_state.html">GameState</a> state, PlayerColor winner) override</td></tr>
<tr class="memdesc:a1fe98e84fb66f6c0b607a956880c1bfb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when a game started with onGameStart is over.  <a href="#a1fe98e84fb66f6c0b607a956880c1bfb">More...</a><br/></td></tr>
<tr class="separator:a1fe98e84fb66f6c0b607a956880c1bfb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a7b592364ab23f8ae13729e83ffc0d4fd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7b592364ab23f8ae13729e83ffc0d4fd"></a>
ChessSetPtr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gui_observer.html#a7b592364ab23f8ae13729e83ffc0d4fd">m_chessSetPtr</a></td></tr>
<tr class="memdesc:a7b592364ab23f8ae13729e83ffc0d4fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shared pointer to the <a class="el" href="class_chess_set.html" title="The ChessSet holds all the figures together with the board needed for the chess game. ">ChessSet</a>. <br/></td></tr>
<tr class="separator:a7b592364ab23f8ae13729e83ffc0d4fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa845ebc3943d71ddd6343c55ba12ef47"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa845ebc3943d71ddd6343c55ba12ef47"></a>
<a class="el" href="class_game_play.html">GamePlay</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gui_observer.html#aa845ebc3943d71ddd6343c55ba12ef47">m_gamePlayState</a></td></tr>
<tr class="memdesc:aa845ebc3943d71ddd6343c55ba12ef47"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shared pointer to the <a class="el" href="class_game_play.html" title="Class which holds the state GamePlay. ">GamePlay</a> state. <br/></td></tr>
<tr class="separator:aa845ebc3943d71ddd6343c55ba12ef47"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Allows to observe relevant GameEvents inside the <a class="el" href="class_game_logic.html" title="GameLogic implementation for a game of chess with observers. ">GameLogic</a>. </p>
<p>Classes of this type can be registered with the <a class="el" href="class_game_logic.html" title="GameLogic implementation for a game of chess with observers. ">GameLogic</a> to be notified of relevant game events.</p>
<dl class="section note"><dt>Note</dt><dd>A Observer is only required to stay in a valid state for one game. It is free to halt its operations after the end of the game.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>None of the functions in the class must block. </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="abe55c1eea61c69281828f1ab99d1ee29"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">GuiObserver::GuiObserver </td>
          <td>(</td>
          <td class="paramtype">ChessSetPtr&#160;</td>
          <td class="paramname"><em>chessSetPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_game_play.html">GamePlay</a> &amp;&#160;</td>
          <td class="paramname"><em>gamePlayState</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new observer object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">chessSetPtr</td><td>A shared pointer to the <a class="el" href="class_chess_set.html" title="The ChessSet holds all the figures together with the board needed for the chess game. ">ChessSet</a> object. </td></tr>
    <tr><td class="paramname">gamePlayState</td><td>A reference to the <a class="el" href="class_game_play.html" title="Class which holds the state GamePlay. ">GamePlay</a> state. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a1fe98e84fb66f6c0b607a956880c1bfb"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void GuiObserver::onGameOver </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_game_state.html">GameState</a>&#160;</td>
          <td class="paramname"><em>state</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PlayerColor&#160;</td>
          <td class="paramname"><em>winner</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called when a game started with onGameStart is over. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">state</td><td>State on game over. </td></tr>
    <tr><td class="paramname">winner</td><td>Winner of the game. </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented from <a class="el" href="class_abstract_game_observer.html#ac24e139ff56d25fb7e77afdfb35fab5c">AbstractGameObserver</a>.</p>

</div>
</div>
<a class="anchor" id="a51629917c7dad975609789161c34bc88"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void GuiObserver::onGameStart </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_game_state.html">GameState</a>&#160;</td>
          <td class="paramname"><em>state</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_game_configuration.html">GameConfiguration</a>&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called when the game starts. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">state</td><td><a class="el" href="class_game_state.html" title="Facade class for the game logic, holds the chessboard and the turn generator. ">GameState</a> on game start. </td></tr>
    <tr><td class="paramname">config</td><td>Valid <a class="el" href="class_game_configuration.html" title="Class for holding game configuration parameters. ">GameConfiguration</a> for this game. </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented from <a class="el" href="class_abstract_game_observer.html#a34fd2b4c53d3beb7c6bb3edebe185150">AbstractGameObserver</a>.</p>

</div>
</div>
<a class="anchor" id="a7f031bc566bff47e84165b0e61e435a8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void GuiObserver::onTurnEnd </td>
          <td>(</td>
          <td class="paramtype">PlayerColor&#160;</td>
          <td class="paramname"><em>who</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_turn.html">Turn</a>&#160;</td>
          <td class="paramname"><em>turn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_game_state.html">GameState</a>&#160;</td>
          <td class="paramname"><em>newState</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called if a player ended its turn. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">who</td><td>Color of the player doing the turn. </td></tr>
    <tr><td class="paramname">turn</td><td><a class="el" href="class_turn.html" title="Represents a chess turn. ">Turn</a> the player decided on. </td></tr>
    <tr><td class="paramname">newState</td><td>State after the player performed the turn. </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented from <a class="el" href="class_abstract_game_observer.html#afc2f078de79701a8cd77ce733459cf6c">AbstractGameObserver</a>.</p>

</div>
</div>
<a class="anchor" id="aa3cc6e321d1c7abc8d2c1b80b747e084"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void GuiObserver::onTurnStart </td>
          <td>(</td>
          <td class="paramtype">PlayerColor&#160;</td>
          <td class="paramname"><em>who</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called if a player is asked to perform a turn. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">who</td><td>Color of the player doing the turn. </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented from <a class="el" href="class_abstract_game_observer.html#a64dd519a6445dc104e7387b394c0286e">AbstractGameObserver</a>.</p>

</div>
</div>
<a class="anchor" id="a12560de73f266b1bbcf9b1dd46c65758"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void GuiObserver::onTurnTimeout </td>
          <td>(</td>
          <td class="paramtype">PlayerColor&#160;</td>
          <td class="paramname"><em>who</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::chrono::seconds&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called if a players turn is aborted due to timeout. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">who</td><td>Color of the player who got interrupted. </td></tr>
    <tr><td class="paramname">timeout</td><td>Length of the time limit that got violated. </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented from <a class="el" href="class_abstract_game_observer.html#a74ba4cdca13bb0227722beeeebfd6e12">AbstractGameObserver</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>S:/dev/3dchess/src/gui/<a class="el" href="_gui_observer_8h_source.html">GuiObserver.h</a></li>
<li>S:/dev/3dchess/src/gui/GuiObserver.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Mar 9 2014 23:12:58 for 3dchess by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
